package com.nuoniu.sibanyun.service.production.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.nuoniu.sibanyun.entity.production.VProductionFinishDetail;
import com.nuoniu.sibanyun.entity.production.VProductionWorkDetail;
import com.nuoniu.sibanyun.mapper.production.VProductionFinishDetailMapper;
import com.nuoniu.sibanyun.service.production.IVProductionFinishDetailService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 生产领退补料单明细 服务实现类
 * </p>
 *
 * @author 小啊刚
 * @since 2021-02-23
 */
@Service
public class VProductionFinishDetailServiceImpl extends ServiceImpl<VProductionFinishDetailMapper, VProductionFinishDetail> implements IVProductionFinishDetailService {

    @Override
    public List<VProductionFinishDetail> listByMainId(Long mainId) {
        QueryWrapper<VProductionFinishDetail> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("order_id",mainId);
        List<VProductionFinishDetail> list = list(queryWrapper);
        return list;
    }

    @Override
    public List<VProductionFinishDetail> getDetailsByOrderId(Long orderId) {
        QueryWrapper<VProductionFinishDetail> queryWrapper = new QueryWrapper();
        queryWrapper.eq("order_id",orderId);
        List<VProductionFinishDetail> list = list(queryWrapper);
        return list;
    }

    @Override
    public void removeByOrderId(Long orderId) {
        QueryWrapper<VProductionFinishDetail> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("order_id",orderId);
        remove(queryWrapper);
    }
}
